<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="oastaglib" prefix="oas" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>审核员工请假</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/bootstrap/dist/css/bootstrap.min.css" /> ">
    <script type="text/javascript" src="<c:url value="/resources/js/jquery/dist/jquery.min.js"/>"></script>
    <script type="text/javascript" src="<c:url value="/resources/bootstrap/dist/js/bootstrap.min.js"/>"></script>


</head>
<body>
<oas:nav/>
<oas:content>

    <div>
        <h1>待审核请假</h1>

        <a href="<c:url value="/manager/leave/leaveChecked"/> ">查看已通过审核请假</a>
            <c:forEach items="${paginationSupport.items}" var="leave">
                <div class="card">
                    <div class="card-header">
                        申请人:
                        <c:out value="${leave.applicant.fullName }"/>
                    </div>
                    <div class="card-body">
                        请假类型:
                        <c:out value="${leave.type.description}"/>
                        <br/>
                        该员工所属部门:
                        <c:out value="${leave.applicant.workcell.name}"/>
                        <br/>
                        请假时间:
                        <fmt:formatDate value="${leave.applyDate}"
                                        pattern="yyyy-MM-dd HH:mm:ss"/>
                        <div>
                            <a href="<c:url value="/manager/leave/${leave.id}" />">查看详情</a>
                        </div>
                    </div>
                    <div class="card-footer">
                        <a class="btn btn-success" href="<c:url value="/manager/leave/checkTrue?id=${leave.id}" />">批准</a>
                        <a class="btn btn-danger" href="<c:url value="/manager/leave/checkFalse?id=${leave.id}" />">不予批准</a>
                    </div>
                </div>

                <br>
            </c:forEach>


    </div>
    <div>
        每页${paginationSupport.pageSize}条待审核请假，
        第${paginationSupport.currentPageNo}/${paginationSupport.totalPageCount}页,共${paginationSupport.totalCount}条请假
        <ul class="pagination">
            <c:if test="${paginationSupport.previousPage}">
                <li class="page-item">
                    <a class="page-link"
                       href="<c:url value="/manager/leave?pageNo=${paginationSupport.currentPageNo-1}" />">上一页</a>
                </li>
            </c:if>
            <c:forEach var="i" begin="1" end="${paginationSupport.totalPageCount}" step="1">
                <li class="page-item">
                    <a class="page-link"
                       href="<c:url value="/manager/leave?pageNo=${i}" />"> ${i}</a>
                </li>
            </c:forEach>
            <c:if test="${paginationSupport.nextPage}">
                <li class="page-item">
                    <a class="page-link"
                       href="<c:url value="/manager/leave?pageNo=${paginationSupport.currentPageNo+1}" />">下一页 </a>
                </li>
            </c:if>
        </ul>
    </div>
</oas:content>
<oas:footer/>
</body>

</html>